<template>
  <view>
    <picker @change="bindPickerChange" :value="index" :range="array" range-key="title">
      <view class="picker">{{array[index].title}}</view>
    </picker>
    <button @click="submit">提交</button>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        array: [{
            id: "1",
            title: "中国"
          },
          {
            id: "2",
            title: "美国"
          },
          {
            id: "3",
            title: "巴西"
          },
          {
            id: "4",
            title: "日本"
          }
        ],
        index: 0
      };
    },
    methods: {
      bindPickerChange(e) {
        this.index = e.detail.value;
      },
      submit() {
        console.log(this.array[this.index])
      }
    }
  }
</script>

<style lang="scss">
  .picker {
    width: 500rpx;
    height: 80rpx;
    border: 1px solid #EEEFEF;
    line-height: 80rpx;
  }
</style>